<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>例子10-JS进阶（二）</title>
    </head>
    <body>
        <pre>
            <code>
                    // 例子10

                    function fn(num1, num2) {
                        console.log(this.a + num1 + num2);
                    }
                    var obj = {
                        a: 20
                    }

                    fn.call(obj, 100, 10); // 130
                    fn.apply(obj, [100, 10]); // 130
                    fn.bind(obj, 100, 10)(); // 130
            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/10.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>
</html>